import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import Myfilm from '../views/MyFilm.vue'
import MyNews from '../views/MyNews.vue'
import MyCenter from '../views/MyCenter.vue'
import MyCinema from '../views/MyCinema.vue'

// 泛型
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/film'
  },
  {
    path: '/film',
    name: 'film',
    component: Myfilm
  }, {
    path: '/center',
    name: 'center',
    component: MyCenter
  }, {
    path: '/cinema',
    name: 'cinema',
    component: MyCinema
  }, {
    path: '/news',
    name: 'news',
    component: MyNews
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
